/**
 * 
 */
package co.fitstart.entity.order;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("paymentStatus")
public enum PaymentStatus {
    
    UNPAID("unpaid", "待支付", "danger"),
    
    PAID("paid", "已支付", "success"),
    
    REFUNDING("refunding", "待退款", "warning"),
    
    REFUNDED("refunded", "已退款", "default"),
    
    SYSTEMREFUNDED("systemRefunded", "系统退款", "default"),
    
    CANCELED("canceled", "系统取消", "default");
    
    private String alias;
    
    private String description;
    
    private String css;
    
    /**
     * 
     * @param alias
     * @param description
     * @param css
     */
    private PaymentStatus(String alias, String description, String css) {
        this.alias = alias;
        this.description = description;
        this.css = css;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static PaymentStatus aliasOf(String alias) {
        for (PaymentStatus paymentStatus : PaymentStatus.values()) {
            if (paymentStatus.getAlias().equalsIgnoreCase(alias)) {
                return paymentStatus;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isUnpaid() {
        return this.equals(UNPAID);
    }
    
    public boolean isPaid() {
        return this.equals(PAID);
    }
    
    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
    
    /**
     * @return the css
     */
    public String getCss() {
        return css;
    }
    
}
